3.3.88 \(\int \cos ^3(e+f x) (b \csc (e+f x))^n \, dx\) [288]

Optimal. Leaf size=52 \[ -\frac {b^3 (b \csc (e+f x))^{-3+n}}{f (3-n)}+\frac {b (b \csc (e+f x))^{-1+n}}{f (1-n)} \]

[Out]

-b^3*(b*csc(f*x+e))^(-3+n)/f/(3-n)+b*(b*csc(f*x+e))^(-1+n)/f/(1-n)

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 52, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {2701, 14} \begin {gather*} \frac {b (b \csc (e+f x))^{n-1}}{f (1-n)}-\frac {b^3 (b \csc (e+f x))^{n-3}}{f (3-n)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[e + f*x]^3*(b*Csc[e + f*x])^n,x]

[Out]

-((b^3*(b*Csc[e + f*x])^(-3 + n))/(f*(3 - n))) + (b*(b*Csc[e + f*x])^(-1 + n))/(f*(1 - n))

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2701

Int[(csc[(e_.) + (f_.)*(x_)]*(a_.))^(m_)*sec[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> Dist[-(f*a^n)^(-1), Subst
[Int[x^(m + n - 1)/(-1 + x^2/a^2)^((n + 1)/2), x], x, a*Csc[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && Integer
Q[(n + 1)/2] &&  !(IntegerQ[(m + 1)/2] && LtQ[0, m, n])

Rubi steps

\begin {align*} \int \cos ^3(e+f x) (b \csc (e+f x))^n \, dx &=-\frac {b^3 \text {Subst}\left (\int x^{-4+n} \left (-1+\frac {x^2}{b^2}\right ) \, dx,x,b \csc (e+f x)\right )}{f}\\ &=-\frac {b^3 \text {Subst}\left (\int \left (-x^{-4+n}+\frac {x^{-2+n}}{b^2}\right ) \, dx,x,b \csc (e+f x)\right )}{f}\\ &=-\frac {b^3 (b \csc (e+f x))^{-3+n}}{f (3-n)}+\frac {b (b \csc (e+f x))^{-1+n}}{f (1-n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.15, size = 45, normalized size = 0.87 \begin {gather*} -\frac {b (-5+n+(-1+n) \cos (2 (e+f x))) (b \csc (e+f x))^{-1+n}}{2 f (-3+n) (-1+n)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[e + f*x]^3*(b*Csc[e + f*x])^n,x]

[Out]

-1/2*(b*(-5 + n + (-1 + n)*Cos[2*(e + f*x)])*(b*Csc[e + f*x])^(-1 + n))/(f*(-3 + n)*(-1 + n))

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 4.34, size = 2446, normalized size = 47.04

method result size
risch \(\text {Expression too large to display}\) \(2446\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(f*x+e)^3*(b*csc(f*x+e))^n,x,method=_RETURNVERBOSE)

[Out]

1/8*I*exp(I*(f*x+e))^n*b^n*(exp(2*I*(f*x+e))-1)^(-n)*2^n/(f*n-3*f)*exp(1/2*I*(-csgn(I*b/(exp(2*I*(f*x+e))-1)*e
xp(I*(f*x+e)))^3*Pi*n+csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*csgn(I*b)*Pi*n+csgn(I*exp(I*(f*x+e))/(ex
p(2*I*(f*x+e))-1))*csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*Pi*n-csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e)
)-1))*csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))*csgn(I*b)*Pi*n+csgn(I*b/(exp(2*I*(f*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I*(f*x
+e))-1)*exp(I*(f*x+e)))^3*Pi*n-csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))^3*Pi*n+csgn(I*exp(I*(f*x+e))/(exp(2
*I*(f*x+e))-1))^2*csgn(I/(exp(2*I*(f*x+e))-1))*Pi*n+csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))^2*csgn(I*exp(I
*(f*x+e)))*Pi*n-csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))*csgn(I*exp(I*(f*x+e)))*csgn(I/(exp(2*I*(f*x+e))-1)
)*Pi*n-csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))*csgn(b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))*Pi*n-csgn(b/(
exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*Pi*n+Pi*n+2*f*x+2*e))-1/8*I/(f*n-3*f)*2^n*(exp(2*I*(f*x+e))-1)^(-n)*b^n*
exp(I*(f*x+e))^n*exp(-1/2*I*(csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^3*Pi*n-csgn(I*b/(exp(2*I*(f*x+e))-1
)*exp(I*(f*x+e)))^2*csgn(I*b)*Pi*n-csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))*csgn(I*b/(exp(2*I*(f*x+e))-1)*e
xp(I*(f*x+e)))^2*Pi*n+csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))*csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e))
)*csgn(I*b)*Pi*n-csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))*csgn(b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*P
i*n-csgn(b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^3*Pi*n+csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))^3*Pi*n-csgn
(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))^2*csgn(I/(exp(2*I*(f*x+e))-1))*Pi*n-csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*
x+e))-1))^2*csgn(I*exp(I*(f*x+e)))*Pi*n+csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))*csgn(I*exp(I*(f*x+e)))*csg
n(I/(exp(2*I*(f*x+e))-1))*Pi*n+csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))*csgn(b/(exp(2*I*(f*x+e))-1)*exp(I
*(f*x+e)))*Pi*n+csgn(b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*Pi*n-Pi*n+6*f*x+6*e))-1/8*I*exp(I*(f*x+e))^n*b^n
*(exp(2*I*(f*x+e))-1)^(-n)*2^n/(-3+n)/(-1+n)/f*(n-9)*exp(-1/2*I*(csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))
^3*Pi*n-csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*csgn(I*b)*Pi*n-csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))
-1))*csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*Pi*n+csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))*csgn(I*b
/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))*csgn(I*b)*Pi*n-csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))*csgn(b/(exp
(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*Pi*n-csgn(b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^3*Pi*n+csgn(I*exp(I*(f*x+e
))/(exp(2*I*(f*x+e))-1))^3*Pi*n-csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))^2*csgn(I/(exp(2*I*(f*x+e))-1))*Pi*
n-csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))-1))^2*csgn(I*exp(I*(f*x+e)))*Pi*n+csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*
x+e))-1))*csgn(I*exp(I*(f*x+e)))*csgn(I/(exp(2*I*(f*x+e))-1))*Pi*n+csgn(I*b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)
))*csgn(b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))*Pi*n+csgn(b/(exp(2*I*(f*x+e))-1)*exp(I*(f*x+e)))^2*Pi*n-Pi*n+2*
f*x+2*e))

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 62, normalized size = 1.19 \begin {gather*} \frac {\frac {b^{n} \sin \left (f x + e\right )^{-n} \sin \left (f x + e\right )^{3}}{n - 3} - \frac {b^{n} \sin \left (f x + e\right )^{-n} \sin \left (f x + e\right )}{n - 1}}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^3*(b*csc(f*x+e))^n,x, algorithm="maxima")

[Out]

(b^n*sin(f*x + e)^(-n)*sin(f*x + e)^3/(n - 3) - b^n*sin(f*x + e)^(-n)*sin(f*x + e)/(n - 1))/f

________________________________________________________________________________________

Fricas [A]
time = 2.92, size = 52, normalized size = 1.00 \begin {gather*} -\frac {{\left ({\left (n - 1\right )} \cos \left (f x + e\right )^{2} - 2\right )} \left (\frac {b}{\sin \left (f x + e\right )}\right )^{n} \sin \left (f x + e\right )}{f n^{2} - 4 \, f n + 3 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^3*(b*csc(f*x+e))^n,x, algorithm="fricas")

[Out]

-((n - 1)*cos(f*x + e)^2 - 2)*(b/sin(f*x + e))^n*sin(f*x + e)/(f*n^2 - 4*f*n + 3*f)

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)**3*(b*csc(f*x+e))**n,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^3*(b*csc(f*x+e))^n,x, algorithm="giac")

[Out]

integrate((b*csc(f*x + e))^n*cos(f*x + e)^3, x)

________________________________________________________________________________________

Mupad [B]
time = 0.63, size = 66, normalized size = 1.27 \begin {gather*} \frac {{\left (\frac {b}{\sin \left (e+f\,x\right )}\right )}^n\,\left (9\,\sin \left (e+f\,x\right )+\sin \left (3\,e+3\,f\,x\right )-n\,\sin \left (e+f\,x\right )-n\,\sin \left (3\,e+3\,f\,x\right )\right )}{4\,f\,\left (n^2-4\,n+3\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(e + f*x)^3*(b/sin(e + f*x))^n,x)

[Out]

((b/sin(e + f*x))^n*(9*sin(e + f*x) + sin(3*e + 3*f*x) - n*sin(e + f*x) - n*sin(3*e + 3*f*x)))/(4*f*(n^2 - 4*n
 + 3))

________________________________________________________________________________________